package com.shallowUniverse.process.mapper.provider;


import com.shallowUniverse.process.context.sql.SqlSentenceUtil;
import com.shallowUniverse.process.entity.ProcessDefinition;

/**
 * @author gs
 * @date create in 2021/1/17 14:24
 */
public class ProcessDefinitionProvider {

    public String selectList(ProcessDefinition processDefinition) {
        //查询字段和条件字符
        String[] entityFields = {"name", "startDate", "endDate"};
        String[] sqlFields = {"name", "create_date", "create_date"};
        String[] signs = {"like", ">=", "<="};
        return SqlSentenceUtil.generateSentenceWithFieldConditions("selectProcess", processDefinition, entityFields, sqlFields, signs);
    }

    public String selectById(Long id) {
        return SqlSentenceUtil.generateSentence("selectProcessById");
    }

    public String insert(ProcessDefinition processDefinition) {
        return SqlSentenceUtil.generateSentence("insertProcess");
    }

    public String deleteLogic(String id) {
        return SqlSentenceUtil.generateSentence("deleteProcessLogic");
    }

    public String delete(String id) {
        return SqlSentenceUtil.generateSentence("deleteProcess");
    }
}
